.class public Lcom/brixd/niceapp/community/model/RankingAppModel;
.super Ljava/lang/Object;
.source "RankingAppModel.java"

# interfaces
.implements Ljava/io/Serializable;


# static fields
.field private static final serialVersionUID:J = -0x16e557447f928f58L


# instance fields
.field public appId:I

.field public iconUrl:Ljava/lang/String;

.field public subTitle:Ljava/lang/String;

.field public title:Ljava/lang/String;

.field public type:I


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 9
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static parseRankingAppModels(Lorg/json/JSONArray;)Ljava/util/ArrayList;
    .registers 6
    .param p0, "ja"    # Lorg/json/JSONArray;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/json/JSONArray;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/brixd/niceapp/community/model/RankingAppModel;",
            ">;"
        }
    .end annotation

    .prologue
    .line 16
    new-instance v3, Ljava/util/ArrayList;

    invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

    .line 17
    .local v3, "rankingAppModels":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/community/model/RankingAppModel;>;"
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_6
    invoke-virtual {p0}, Lorg/json/JSONArray;->length()I

    move-result v4

    if-ge v0, v4, :cond_3b

    .line 18
    invoke-virtual {p0, v0}, Lorg/json/JSONArray;->optJSONObject(I)Lorg/json/JSONObject;

    move-result-object v1

    .line 19
    .local v1, "rankingAppJson":Lorg/json/JSONObject;
    new-instance v2, Lcom/brixd/niceapp/community/model/RankingAppModel;

    invoke-direct {v2}, Lcom/brixd/niceapp/community/model/RankingAppModel;-><init>()V

    .line 21
    .local v2, "rankingAppModel":Lcom/brixd/niceapp/community/model/RankingAppModel;
    const-string v4, "id"

    invoke-virtual {v1, v4}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v4

    iput v4, v2, Lcom/brixd/niceapp/community/model/RankingAppModel;->appId:I

    .line 22
    const-string v4, "title"

    invoke-virtual {v1, v4}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    iput-object v4, v2, Lcom/brixd/niceapp/community/model/RankingAppModel;->title:Ljava/lang/String;

    .line 23
    const-string v4, "sub_title"

    invoke-virtual {v1, v4}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    iput-object v4, v2, Lcom/brixd/niceapp/community/model/RankingAppModel;->subTitle:Ljava/lang/String;

    .line 24
    const-string v4, "icon_image"

    invoke-virtual {v1, v4}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    iput-object v4, v2, Lcom/brixd/niceapp/community/model/RankingAppModel;->iconUrl:Ljava/lang/String;

    .line 26
    invoke-virtual {v3, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 17
    add-int/lit8 v0, v0, 0x1

    goto :goto_6

    .line 29
    .end local v1    # "rankingAppJson":Lorg/json/JSONObject;
    .end local v2    # "rankingAppModel":Lcom/brixd/niceapp/community/model/RankingAppModel;
    :cond_3b
    return-object v3
.end method

.method public static parseRankingAppModelsWithJsonObj(Lorg/json/JSONObject;)Ljava/util/ArrayList;
    .registers 7
    .param p0, "jo"    # Lorg/json/JSONObject;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/json/JSONObject;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/brixd/niceapp/community/model/RankingAppModel;",
            ">;"
        }
    .end annotation

    .prologue
    .line 33
    const-string v5, "apps"

    invoke-virtual {p0, v5}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v1

    .line 35
    .local v1, "ja":Lorg/json/JSONArray;
    new-instance v4, Ljava/util/ArrayList;

    invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V

    .line 36
    .local v4, "rankingAppModels":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/community/model/RankingAppModel;>;"
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_c
    invoke-virtual {v1}, Lorg/json/JSONArray;->length()I

    move-result v5

    if-ge v0, v5, :cond_49

    .line 37
    invoke-virtual {v1, v0}, Lorg/json/JSONArray;->optJSONObject(I)Lorg/json/JSONObject;

    move-result-object v2

    .line 38
    .local v2, "rankingAppJson":Lorg/json/JSONObject;
    new-instance v3, Lcom/brixd/niceapp/community/model/RankingAppModel;

    invoke-direct {v3}, Lcom/brixd/niceapp/community/model/RankingAppModel;-><init>()V

    .line 40
    .local v3, "rankingAppModel":Lcom/brixd/niceapp/community/model/RankingAppModel;
    const-string v5, "article_id"

    invoke-virtual {v2, v5}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v5

    iput v5, v3, Lcom/brixd/niceapp/community/model/RankingAppModel;->appId:I

    .line 41
    const-string v5, "title"

    invoke-virtual {v2, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    iput-object v5, v3, Lcom/brixd/niceapp/community/model/RankingAppModel;->title:Ljava/lang/String;

    .line 42
    const-string v5, "sub_title"

    invoke-virtual {v2, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    iput-object v5, v3, Lcom/brixd/niceapp/community/model/RankingAppModel;->subTitle:Ljava/lang/String;

    .line 43
    const-string v5, "icon_image"

    invoke-virtual {v2, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    iput-object v5, v3, Lcom/brixd/niceapp/community/model/RankingAppModel;->iconUrl:Ljava/lang/String;

    .line 44
    const-string v5, "article_type"

    invoke-virtual {v2, v5}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v5

    iput v5, v3, Lcom/brixd/niceapp/community/model/RankingAppModel;->type:I

    .line 46
    invoke-virtual {v4, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 36
    add-int/lit8 v0, v0, 0x1

    goto :goto_c

    .line 49
    .end local v2    # "rankingAppJson":Lorg/json/JSONObject;
    .end local v3    # "rankingAppModel":Lcom/brixd/niceapp/community/model/RankingAppModel;
    :cond_49
    return-object v4
.end method
